/*
 * vim: ts=4 sw=4 fdm=marker noet tw=78 ai
 * %%LICENSE%%
 */
#include <sys/cdefs.h>
#ifdef __FBSDID
__FBSDID("$Coar$");
#endif

#include <assert.h>
#include <err.h>
#include <sysexits.h>

#include "extern.h"
#include "hash.h"

void
lde_hash_file(runtime_t *ctx)
{
	assert(ctx != NULL);
	assert(ctx->fname != NULL);
	TRACEIN(ctx, __func__, "Hashing %s", ctx->fname);

	if( (ctx->fhash = SHA_File(ctx->fname, NULL)) == NULL )
		err(EX_OSERR, "Unable to hash file");

	TRACEOUT(ctx, __func__, "hash = %40s", ctx->fhash);
}
